{{extend 'layout.html'}}
{{
chartoptions = "{type: 'bar', barColor: 'green', 'chartRangeMin': '%d', 'chartRangeMax': '%d'}"%(chartmin,chartmax)
jsonurl = URL(r=request,f='call/json/sparkdata/%(ngraphs)d/%(chartmin)d/%(chartmax)d'%locals())
}}
<script type="text/javascript">
    /* <![CDATA[ */
    $(function() {
        $(this).everyTime(1000,function(i) {
            $.getJSON('{{=jsonurl}}', function(data) { 
            {{for n in xrange(ngraphs):}}
                $("#dynbar{{=n}}").sparkline(data.dynbar{{=n}}, {{=chartoptions}});
                {{pass}}
            });
        });
    });
    /* ]]> */
</script> 
<h1>This is the sparkline.html template</h1>
{{for n in xrange(ngraphs):}}
<p>
Bar chart with dynamic data: <span id="dynbar{{=n}}" class="dynamicbar">Loading..</span>
</p>
{{pass}}


{{=BEAUTIFY(response._vars)}}
